// vim:ft=javascript

ARG_ENABLE("phpy", "enable phpy extension", "yes");

if (PHP_PHPY != "no") {

    swoole_source_file="phpy.cc \
        src/bridge/core.cc \
        src/php/object.cc src/php/type.cc src/php/dict.cc  src/php/core.cc src/php/fn.cc src/php/str.cc src/php/sequence.cc src/php/list.cc  src/php/set.cc src/php/tuple.cc src/php/module.cc \
        src/python/class.cc src/python/module.cc src/python/object.cc src/python/reference.cc src/python/resource.cc src/python/callable.cc \
    "

    PHP_REQUIRE_CXX()

    PHP_ADD_INCLUDE(/opt/anaconda3/include/python3.11)
    PHP_ADD_LIBRARY_WITH_PATH(python3.11, /opt/anaconda3/lib, PHPY_SHARED_LIBADD)
    PHP_SUBST(PHPY_SHARED_LIBADD)

    CXXFLAGS="$CXXFLAGS -Wall -Wno-unused-function -Wno-deprecated -Wno-deprecated-declarations -z now"
    CXXFLAGS="$CXXFLAGS -std=c++14"

	EXTENSION("phpy", "test.c observer.c fiber.c", PHP_PHPY_SHARED, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
	ADD_FLAG("CFLAGS_PHPY", "/D PHP_PHPY_EXPORTS ");
}
